package com.seedwill.common.meta.db;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.seedwill.common.meta.IContext;
import com.seedwill.common.meta.IData;
import com.seedwill.common.unit.ICell;

/**
 * 自维护表的表
 * 
 * 
 * 
 * @author yikuide@gmail.com
 *
 */
public class XTable extends com.seedwill.common.unit.base.AEventSupportCell  implements ICell {
	
	public XTable(String identityName, IData identityVal,
			Serializable serializableIdentity) {
		super(identityName, identityVal, serializableIdentity);
		// TODO Auto-generated constructor stub
	}
	public XTable(String identityName, IData identityVal) {
		super(identityName, identityVal);
		// TODO Auto-generated constructor stub
	}
	public XTable(String identityName, Serializable serializableIdentity) {
		super(identityName, serializableIdentity);
		// TODO Auto-generated constructor stub
	}

	private List<XKey> keys = new ArrayList<XKey>();;
	
	private List<XColumn> columns = new ArrayList<XColumn>();
	
	private List<XTrigger> triggers = new ArrayList<XTrigger>();
	
	public void addKey(XKey key){
		keys.add(key);
	}
	public void addColumn(XColumn column){
		columns.add(column);
	}
	
	public void removeKey(XKey key){
		if(keys.contains(key)){
			keys.remove(key);
		}
	}
	
	public void removeColumn(XColumn column){
		if(columns.contains(column)){
			columns.remove(column);
		}
	}
	
	public void cleanKey(){
		keys.clear();
	}
	public void cleanColumn(){
		columns.clear();
	}

	public List<XTrigger> getTriggers() {
		return triggers;
	}
	public void setTriggers(List<XTrigger> triggers) {
		this.triggers = triggers;
	}
 
	@Override
	public Object process(IContext ctx) {
		// TODO Auto-generated method stub
		return null;
	}
 
}
